# Maintainer:  Bartłomiej Piotrowski <bpiotrowski@archlinux.org>
# Contributor: Jan de Groot <jgc@archlinux.org>
# Contributor: Adam Walters <abwalters@abwalters.us>
# Contributor: William Rea <sillywilly@gmail.com>
# Contributor: Rémy Oudompheng <remy@archlinux.org>

pkgname=libatomic_ops
pkgver=7.6.12
pkgrel=1
pkgdesc='Provides semi-portable access to hardware provided atomic memory operations'
arch=(x86_64)
url='https://github.com/ivmai/libatomic_ops'
depends=(glibc)
license=(GPL2 MIT)
options=(!docs)
source=($url/releases/download/v$pkgver/${pkgname}-${pkgver}.tar.gz)
sha256sums=('f0ab566e25fce08b560e1feab6a3db01db4a38e5bc687804334ef3920c549f3e')

build() {
  cd $pkgname-$pkgver
  ./configure --prefix=/usr --disable-static --enable-shared
  make
}

check() {
  cd $pkgname-$pkgver
  make check
}

package() {
  cd $pkgname-$pkgver
  make DESTDIR="$pkgdir" install
  install -Dm644 doc/LICENSING.txt "$pkgdir/usr/share/licenses/$pkgname/LICENSE"
}
